﻿@page "/table/cell"
@inject IStringLocalizer<NavMenu> NavMenuLocalizer
@inject IStringLocalizer<TablesCell> Localizer
@inject IStringLocalizer<Foo> FooLocalizer
@inject ToastService ToastService

<h3>@Localizer["TablesCellTitle"] - @NavMenuLocalizer["TableCell"]</h3>

<h4>@Localizer["TablesCellDescription"]</h4>

<HeadContent>
    <style>
        .cell-demo {
            --bs-table-bg: #e9ecef;
        }
    </style>
</HeadContent>

<DemoBlock Title="@Localizer["TableCellMergeCellTitle"]"
           Introduction="@Localizer["TableCellMergeCellIntro"]"
           Name="MergeCell">
    <section ignore>
        <p>@((MarkupString)Localizer["TableCellMergeCellTip"].Value)</p>
        <Pre class="mb-3">.cell-demo {
    --bs-table-bg: #e9ecef;
}</Pre>
    </section>
    <Table TItem="Foo" Items="@Items.Take(3)">
        <TableColumns>
            <TableColumn @bind-Field="@context.DateTime" Width="140" />
            <TableColumn @bind-Field="@context.Name" OnCellRender="@OnCellRenderHandler" />
            <TableColumn @bind-Field="@context.Address" />
        </TableColumns>
    </Table>
</DemoBlock>

<DemoBlock Title="@Localizer["TableCellOnDoubleClickCellTitle"]"
           Introduction="@Localizer["TableCellOnDoubleClickCellIntro"]"
           Name="OnDoubleClickCell">
    <section ignore>
        <Tips>
            <p>@((MarkupString)Localizer["TableCellOnDoubleClickCellTip"].Value)</p>
        </Tips>
    </section>
    <Table TItem="Foo" Items="@Items.Take(3)" IsBordered="true" OnDoubleClickCellCallback="@OnDoubleClickCellCallback">
        <TableColumns>
            <TableColumn @bind-Field="@context.DateTime" Width="180" />
            <TableColumn @bind-Field="@context.Name" />
            <TableColumn @bind-Field="@context.Address" />
            <TableColumn @bind-Field="@context.Complete" />
        </TableColumns>
    </Table>
</DemoBlock>

<AttributeTable Items="GetAttributes()" Title="TableCell" />
